package com.shoping.common.exception;


import org.springframework.http.HttpStatus;

/**
 * 在业务允许范围之外 触发报警 httpStatus 500  code 503
 *
 * @author zengweilong
 */
public class HttpException extends BaseException {

    private static final long serialVersionUID = -6605859700154199562L;

    private Boolean readOnly = true;

    public HttpException(String errMsg) {
        super(String.valueOf(HttpStatus.SERVICE_UNAVAILABLE.value()), errMsg);
    }

    public HttpException(String errMsg, boolean readOnly) {
        super(String.valueOf(HttpStatus.SERVICE_UNAVAILABLE.value()), errMsg);
        this.readOnly = readOnly;
    }

    public HttpException(String code, String errMsg) {
        super(code, errMsg);
    }

    public HttpException(String code, String errMsg, boolean readOnly) {
        super(code, errMsg);
        this.readOnly = readOnly;
    }

    public Boolean getReadOnly() {
        return readOnly;
    }

    public void setReadOnly(Boolean readOnly) {
        this.readOnly = readOnly;
    }
}
